<template>
  <com-card>
    <div slot="com_header"></div>
    <div slot="com_content">
      <el-row>
        <el-table :data="dataSource" border>
          <el-table-column type="index" label="序号"></el-table-column>
          <el-table-column prop="authName" label="权限名称"></el-table-column>
          <el-table-column prop="path" label="权限路径"></el-table-column>
          <el-table-column prop="level" label="权限级别">
            <template #default="{row}">
                <el-tag v-show="row.level==0">一级</el-tag>
                <el-tag type="success" v-show="row.level==1">二级</el-tag>
                <el-tag type="danger" v-show="row.level==2">三级</el-tag>
                
                <!-- <el-tag :type="row.level==0?'':(row.level==1?'success':'warning')">
                    {{row.level==0?'一级':(row.level==1?'二级':'三级')}}
                </el-tag> -->
            </template>
          </el-table-column>
        </el-table>
      </el-row>
    </div>
  </com-card>
</template>

<script>
import { api_getRight } from "../../api/right.js";
import ComCard from "../../components/comCard";
export default {
  components: {
    ComCard,
  },
  data() {
    return {
      dataSource: [],
    };
  },
  mounted() {
    this.query();
  },
  methods: {
    async query() {
      let rst = await api_getRight({ url: "list" });
      if (rst.meta.status == 200) {
        this.dataSource = rst.data;
      }
      console.log(rst);
    },
  },
};
</script>

<style lang="less" scoped>
</style>